// import { getAllRoleList } from '/@/api/demo/system';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

const myMap = new Map<number, any>([
  [1, '启用'],
  [0, '禁用'],
]);
export const columns: BasicColumn[] = [
  {
    title: '规格编码',
    dataIndex: 'number',
    width: 120,
  },
  {
    title: '规格名称',
    dataIndex: 'name',
    width: 120,
  },
  {
    title: '状态',
    dataIndex: 'state',
    width: 200,
    /* format: (text) => {
      return text ? '启用' : '禁用';
    },*/
    format: myMap,
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: 200,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'number',
    label: '规格编码',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'name',
    label: '规格名称',
    component: 'Input',
    colProps: { span: 8 },
  },
];
export const practiceFormSchema: FormSchema[] = [
  {
    label: '规格编码',
    field: 'number',
    component: 'Input',
    required: true,
  },
  {
    label: '规格名称',
    field: 'name',
    component: 'Input',
    required: true,
  },
  {
    label: '状态',
    field: 'state',

    component: 'RadioGroup',
    componentProps: {
      defaultValue: 1,
      options: [
        {
          label: '启用',
          value: 1,
        },
        {
          label: '禁用',
          value: 2,
        },
      ],
    },
    required: true,
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
];
